#include "sysv_msg.h"

int main(int argc,char *argv[])
{
  int c , flag , mqid;
  flag = MSG_MODE | IPC_CREAT;
  while((c=getopt(argc,argv,"e")) !=-1){
     switch(c){
        case 'e':
           flag |= IPC_EXCL;
          break;
     }
  }
 
  if(optind != (argc-1))
    err_sys("Usage: msgget [-e] <pathname>");

  mqid = msgget(ftok(argv[optind],0),flag);
  if(mqid == -1)
    err_sys("msgget error");
  return 0;
}
